package com.dwarfeng.judge.node.handler;

import com.dwarfeng.subgrade.stack.handler.Handler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class LauncherSettingHandler implements Handler {

    @Value("${launcher.reset_analyser_support}")
    private boolean resetAnalyserSupport;

    @Value("${launcher.reset_driver_support}")
    private boolean resetDriverSupport;

    @Value("${launcher.reset_judger_support}")
    private boolean resetJudgerSupport;

    @Value("${launcher.reset_sinker_support}")
    private boolean resetSinkerSupport;

    @Value("${launcher.reset_provider_support}")
    private boolean resetProviderSupport;

    @Value("${launcher.reset_visualizer_support}")
    private boolean resetVisualizerSupport;

    @Value("${launcher.start_reset_delay}")
    private long startResetDelay;

    @Value("${launcher.online_task_check_delay}")
    private long onlineTaskCheckDelay;
    @Value("${launcher.enable_task_check_delay}")
    private long enableTaskCheckDelay;

    @Value("${launcher.start_receive_delay}")
    private long startReceiveDelay;

    @Value("${launcher.online_supervise_delay}")
    private long onlineSuperviseDelay;
    @Value("${launcher.enable_supervise_delay}")
    private long enableSuperviseDelay;

    @Value("${launcher.online_purge_delay}")
    private long onlinePurgeDelay;
    @Value("${launcher.enable_purge_delay}")
    private long enablePurgeDelay;

    public boolean isResetAnalyserSupport() {
        return resetAnalyserSupport;
    }

    public boolean isResetDriverSupport() {
        return resetDriverSupport;
    }

    public boolean isResetJudgerSupport() {
        return resetJudgerSupport;
    }

    public boolean isResetSinkerSupport() {
        return resetSinkerSupport;
    }

    public boolean isResetProviderSupport() {
        return resetProviderSupport;
    }

    public boolean isResetVisualizerSupport() {
        return resetVisualizerSupport;
    }

    public long getStartResetDelay() {
        return startResetDelay;
    }

    public long getOnlineTaskCheckDelay() {
        return onlineTaskCheckDelay;
    }

    public long getEnableTaskCheckDelay() {
        return enableTaskCheckDelay;
    }

    public long getStartReceiveDelay() {
        return startReceiveDelay;
    }

    public long getOnlineSuperviseDelay() {
        return onlineSuperviseDelay;
    }

    public long getEnableSuperviseDelay() {
        return enableSuperviseDelay;
    }

    public long getOnlinePurgeDelay() {
        return onlinePurgeDelay;
    }

    public long getEnablePurgeDelay() {
        return enablePurgeDelay;
    }

    @Override
    public String toString() {
        return "LauncherSettingHandler{" +
                "resetAnalyserSupport=" + resetAnalyserSupport +
                ", resetDriverSupport=" + resetDriverSupport +
                ", resetJudgerSupport=" + resetJudgerSupport +
                ", resetSinkerSupport=" + resetSinkerSupport +
                ", resetProviderSupport=" + resetProviderSupport +
                ", resetVisualizerSupport=" + resetVisualizerSupport +
                ", startResetDelay=" + startResetDelay +
                ", onlineTaskCheckDelay=" + onlineTaskCheckDelay +
                ", enableTaskCheckDelay=" + enableTaskCheckDelay +
                ", startReceiveDelay=" + startReceiveDelay +
                ", onlineSuperviseDelay=" + onlineSuperviseDelay +
                ", enableSuperviseDelay=" + enableSuperviseDelay +
                ", onlinePurgeDelay=" + onlinePurgeDelay +
                ", enablePurgeDelay=" + enablePurgeDelay +
                '}';
    }
}
